
<!DOCTYPE html>
<html>
<head>
    <title>大乐透数据分析</title>
<style>

body {
    width: 600px;
    margin: 40px auto;
    font-family: 'trebuchet MS', 'Lucida sans', Arial;
    font-size: 14px;
    color: #444;
}

table {
    *border-collapse: collapse; /* IE7 and lower */
    border-spacing: 0;
    width: 100%;    
}

.bordered {
    border: solid #ccc 1px;
    -moz-border-radius: 6px;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    -webkit-box-shadow: 0 1px 1px #ccc; 
    -moz-box-shadow: 0 1px 1px #ccc; 
    box-shadow: 0 1px 1px #ccc;         
}

.bordered tr:hover {
    background: #fbf8e9;
    -o-transition: all 0.1s ease-in-out;
    -webkit-transition: all 0.1s ease-in-out;
    -moz-transition: all 0.1s ease-in-out;
    -ms-transition: all 0.1s ease-in-out;
    transition: all 0.1s ease-in-out;     
}    
    
.bordered td, .bordered th {
    border-left: 1px solid #ccc;
    border-top: 1px solid #ccc;
    padding: 10px;
    text-align: left;    
}

.bordered th {
    background-color: #dce9f9;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#ebf3fc), to(#dce9f9));
    background-image: -webkit-linear-gradient(top, #ebf3fc, #dce9f9);
    background-image:    -moz-linear-gradient(top, #ebf3fc, #dce9f9);
    background-image:     -ms-linear-gradient(top, #ebf3fc, #dce9f9);
    background-image:      -o-linear-gradient(top, #ebf3fc, #dce9f9);
    background-image:         linear-gradient(top, #ebf3fc, #dce9f9);
    -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; 
    -moz-box-shadow:0 1px 0 rgba(255,255,255,.8) inset;  
    box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;        
    border-top: none;
    text-shadow: 0 1px 0 rgba(255,255,255,.5); 
}

.bordered td:first-child, .bordered th:first-child {
    border-left: none;
}

.bordered th:first-child {
    -moz-border-radius: 6px 0 0 0;
    -webkit-border-radius: 6px 0 0 0;
    border-radius: 6px 0 0 0;
}

.bordered th:last-child {
    -moz-border-radius: 0 6px 0 0;
    -webkit-border-radius: 0 6px 0 0;
    border-radius: 0 6px 0 0;
}

.bordered th:only-child{
    -moz-border-radius: 6px 6px 0 0;
    -webkit-border-radius: 6px 6px 0 0;
    border-radius: 6px 6px 0 0;
}

.bordered tr:last-child td:first-child {
    -moz-border-radius: 0 0 0 6px;
    -webkit-border-radius: 0 0 0 6px;
    border-radius: 0 0 0 6px;
}

.bordered tr:last-child td:last-child {
    -moz-border-radius: 0 0 6px 0;
    -webkit-border-radius: 0 0 6px 0;
    border-radius: 0 0 6px 0;
}

</style>
</head>

<body>
<form name="total_count" method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" >
<?php

/* 引用函数库 */
require_once 'configure.php';

$show_title="<h2>大乐透分区出号总数统计</h2>";
echo $show_title;

$query_object="red_one";
$sort_type="desc";
$amount=100;
$mysql_table_name="history_number";

$sql_text="select count(issue) from ".$mysql_table_name;
$total_count=mysql_select($sql_text,$fetch_amount="one",$fetch_type="assoc");

if($_SERVER['REQUEST_METHOD'] == "POST"){
	$show_msg="最近".$_POST['number_select']."期（总计".$total_count['count(issue)']."期），".show_area($_POST['static_select_array']);
    $th_title_array=array($show_msg,"总出现次数","出号百分比");
    $source_data_array=total_count($_POST['static_select_array'],$sort_type,$_POST['number_select'],$mysql_table_name);
    $show_total_table=show_total_table($_POST['static_select_array'],3,"bordered",$th_title_array,$source_data_array,$_POST['number_select']);	
}
else{
	$show_msg="最近".$amount."期（总计".$total_count['count(issue)']."期），".show_area($query_object);
    $th_title_array=array($show_msg,"总出现次数","出号百分比");
    $source_data_array=total_count($query_object,$sort_type,$amount,$mysql_table_name);
    $show_total_table=show_total_table($query_object,3,"bordered",$th_title_array,$source_data_array,$amount);
}

$show_control_table  = "<table class='bordered'><thead>";
$show_control_table .= "<tr>";
$show_control_table .= "<th>".show_static_select(1).show_count_select(500)."</th>";
$show_control_table .= "<th>".show_submit("提交数据")."</th>";
$show_control_table .= "</tr>";
$show_control_table .= "</thead>";
$show_control_table .= "</table>";

echo $show_total_table."<br>";
echo $show_control_table;

?>

</form>
</body>
</html>
